package com.burges.net.typeInformation;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.streaming.api.scala.DataStream;
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment;

/**
 * JavaAPI 类型信息
 * 创建人    BurgessLee
 * 创建时间   2020/1/25
 * 描述
 */
public class JavaAPITypeInformation {


    public static void main(String[] args) {
        StreamExecutionEnvironment evn = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStream<String> input = evn.readTextFile("file:///path/file");
//        input.map(new MyMapFunction<String, Integer>())
//                .returns(new TypeHint<Integer>());

    }

    static class MyMapFunction<T, O> implements MapFunction<T, O>{

        public O map(T t) throws Exception {
            //定义转换逻辑
            return (O)t;
        }
    }

}
